#include <func.h>

int main(int argc, char* argv[])
{
	int fd = open("text1", O_RDWR | O_CREAT | O_APPEND, 0666);
	if (fd == -1) {
		error(1, errno, "open text1");
	}

	// 返回最小可用的文件描述符
	printf("fd: %d\n", fd); // fd: 3
	
	printf("pos: %ld\n", lseek(fd, 0, SEEK_CUR));
	write(fd, "X", 1);
	printf("pos: %ld\n", lseek(fd, 0, SEEK_CUR));

    return 0;
}

